const {join, resolve, posix, win32, relative, dirname, format, normalize, basename, extname} = require('path');

// let res = join('/a', '/b', '', 'c');
// let res = join('/');
// let res = resolve('a','b','c');
// res = resolve('/c', 'b');
// res = resolve('./');
res = resolve();
res = resolve('./test');
res = resolve('a','/b');
res = resolve('/test');
res = resolve('a','b','c/');
// res = resolve('../');
console.log(`res: ${res}`);
console.log(posix.sep);
console.log(win32.sep);

res = join('','');  // .
res = join('/a','/b/');

res = relative('/tmp','');

res = dirname(__filename);
res = dirname(__dirname+'/');
res = dirname('/tmp/test/src/')

res = normalize(format({
    root: '/tmp/dir/..',
    base: 'test.js'
}));

// res = normalize('/tmp/test/dir/');
// res = normalize('/tmp/test/dir/../test.js');
res = basename('/tmp/test/../', '');
res = extname('index.index');
res = resolve('../');
res = resolve('/c');
console.log(res);

